package vn.edu.fpt.taskmanager.logging;

import org.apache.log4j.Logger;

import de.mindpipe.android.logging.log4j.LogConfigurator;

/**
 * A helper class to configure Log4j for android. 
 * This program use Log4j and Android-logging-log4j for logging. 
 * @author GaSjeuThjt
 */
public class Log4jConfigurator {
	
	private static LogConfigurator logConfigurator = new LogConfigurator();
	
	public static void Configure(String fileName, String filePattern, int maxBackupSize, long maxFileSize) {
		
		// Set properties
		logConfigurator.setFileName(fileName);
		logConfigurator.setFilePattern(filePattern);
		logConfigurator.setMaxBackupSize(maxBackupSize);
		logConfigurator.setMaxFileSize(maxFileSize);
		
		// Configure
		logConfigurator.configure();
	}
	
	public static Logger getRootLogger() {
		return Logger.getRootLogger();
	}
	
	public static Logger getLogger(Class<?> Class) {
		return Logger.getLogger(Class);
	}
	
}
